import type { Options } from '@swc/wasm-typescript';
import wts = require('@swc/wasm-typescript');

const transformSync = wts.transformSync;
const options = {
  mode: 'transform',
  transform: {
    verbatimModuleSyntax: true,
    nativeClassProperties: true,
    noEmptyExport: true,
    importNotUsedAsValues: 'preserve',
  },
} satisfies Options;

console.log('Begin 1');
console.log(
  transformSync(
    `
export function foo() {
	return 'foo';
};
`,
    options,
  ).code,
);
console.log('End 1');

console.log('Begin 2');
console.log(
  transformSync(
    `
export function foo() {
	if (false) {
	}
	return 'foo';
};
`,
    options,
  ).code,
);
console.log('End 2');
